<template>
	<view>
		<input v-model="num1" type="number" placeholder="请输入第一个数字"/>
		<view>{{operation}}</view>
		<input v-model="num2" type="number" placeholder="请输入第二个数字"/>
		
		<button @click.stop="calculate">计算</button>
	</view>
</template>

<script setup>
import { ref } from 'vue';
	const num1 = ref(0)
	const num2 = ref(0)
	
	const props = defineProps({
		operation : { type:String,default:'+' }
	})
	
	const emit = defineEmits(['calculate'])
	
	const calculate = () =>{
		emit('calculate',{num1:num1.value,num2:num2.value})
	}
</script>

<style lang="less" scoped>

</style>